﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Mobile_H.Master" Inherits="System.Web.Mvc.ViewPage<Bias_Stock.Models.CountCartModel.data_ds>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Count_Cart</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="MainContent" runat="server">
    <style type="text/css">
        input.ui-input-text
        {
            height: 25px;
            background-color: #FFF;
            border: 1px solid #bbbbbb;
            -webkit-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset;
            -moz-box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset;
            box-shadow: 0 1px 3px rgba(0,0,0,0.3) inset;
            width: 95%;
        }
        
        .hide
        {
            display: none;
        }
        tr
        {
            height: 35px;
            text-align: right;
            background-color: #fff;
        }
        tr.dis
        {
            background-color: #FFFFC2;
        }
    </style>
</asp:Content>
<asp:Content ID="Content4" ContentPlaceHolderID="FeaturedContent" runat="server">
    <div style="background-color: #8094AE; height: 50px; margin-top: 0px;">
        <h2 style="color: White; vertical-align: middle;">
            &nbsp;COUNT</h2>
    </div>
    <div id="page1">
        <table style="width: 100%; font-size: medium; color: #004080; padding: 5px; font-weight: bold;">
            <tr class="dis">
                <td style="width: 30%; text-align: right;">
                    DATE : &nbsp;
                </td>
                <td style="text-align: left;">
                    &nbsp;&nbsp;
                    <%= WinNemoLib.DateUtil.ToDisplayDate(DateTime.Now) %>
                </td>
            </tr>
            <tr class="dis">
                <td>
                    EMP : &nbsp;
                </td>
                <td style="text-align: left;">
                    &nbsp;&nbsp;
                    <%= User.Identity.Name.ToString() %>
                </td>
            </tr>
            <tr id="area" class="dis">
                <td>
                    Area : &nbsp;
                </td>
                <td style="text-align: left;">
                    &nbsp;&nbsp;<%: Model._area %>
                </td>
            </tr>
            <tr>
                <td>
                    Cart : &nbsp;
                </td>
                <td style="text-align: left;">
                    <input type="text" class="ui-input-text" />
                </td>
            </tr>
        </table>
        <input type="button" id="back" value="Back" style="width: 50%" />
    </div>
</asp:Content>
<asp:Content ID="Content5" ContentPlaceHolderID="ScriptsSection" runat="server">
    <% if (false)
       { %>
    <script src="../../Scripts/jquery-1.7.1.js" type="text/javascript"></script>
    <% } %>
    <script type="text/jscript">
        function calltoJSFunction(e) {
            if (window.event) {
                e = window.event;
            }

            if (e.keyCode == 13) {
                if ($("input.ui-input-text").val() == "") {
                    alert("Input Data");
                    return;
                }

            }
        }

        $(function () {

            function Go_toTag() {

                if ($("input.ui-input-text").val() == "") {
                    alert("Input Data");
                    return;
                }

                $.post('<%= Url.Action("CartInDB") %>' + '?cartno=' + $("input.ui-input-text").val() + '&notuse=true', null
                , function (data) {
                    if (data == "1") {
                        window.location = '<%= Url.Action("Count_Tag") %>' + '?area=' + '<%: Model._area %>' + '&cart=' + $("input.ui-input-text").val();
                    }
                    else {
                        alert("Cartno Not Use");
                        $("input.ui-input-text").val("");
                    }

                });
            }

            $("input.ui-input-text").keypress(function (evt) {
                evt = (evt) ? evt : (window.event) ? event : null;
                if (evt) {
                    var charCode = (evt.charCode) ? evt.charCode : ((evt.keyCode) ? evt.keyCode : ((evt.which) ? evt.which : 0));

                    if (charCode == 13) {
                        Go_toTag()
                    }
                }
            });

            $("input.ui-input-text").keydown(function (evt) {
                if (evt.keyCode == 13) {
                    Go_toTag()                 
                }
            });


            $("input.ui-input-text").focus();
            $("#back").click(function () {
                window.location = '<%= Url.Action("Count") %>'
            });
            $("input.ui-input-text").autoNumeric({ vMin: '0', vMax: '999', aPad: false });

        });
    </script>
</asp:Content>
